# StockManagementSystem.pro
QT       += core gui widgets sql axcontainer

TARGET = StockManagementSystem
TEMPLATE = app

# 版本信息
VERSION = 0.1.0

# C++标准设置
CONFIG += c++17

# 自动处理moc、uic、rcc
CONFIG += qt warn_on depend_includepath
CONFIG += uic resources

# 源文件
SOURCES += \
    editcommodity.cpp \
    main.cpp \
    mainwidget.cpp \
    addcommodity.cpp \
    inbound.cpp \
    delivery.cpp \
    datasum.cpp

# 头文件
HEADERS += \
    editcommodity.h \
    mainwidget.h \
    addcommodity.h \
    inbound.h \
    delivery.h \
    datasum.h

# 界面文件
FORMS += \
    editcommodity.ui \
    mainwidget.ui \
    addcommodity.ui \
    inbound.ui \
    delivery.ui \
    datasum.ui

# 资源文件
RESOURCES += resource.qrc

# macOS特定设置
macx {
    # 应用程序包设置
    CONFIG += app_bundle
    BUNDLE = $$TARGET
    
    # 版本信息
    QMAKE_INFO_PLIST = Info.plist
    
    # 包标识符
    QMAKE_TARGET_BUNDLE_PREFIX = com.example
    QMAKE_BUNDLE = $${TARGET}.app
    
    # 版本设置
    QMAKE_TARGET_PRODUCT = $${TARGET}
    QMAKE_TARGET_COMPANY = "Example Company"
    QMAKE_TARGET_DESCRIPTION = "Stock Management System"
    QMAKE_TARGET_COPYRIGHT = "Copyright 2024 Example Company"
}

# Windows特定设置
win32 {
    # 设置为Windows GUI应用程序
    CONFIG += console
    CONFIG -= app_bundle
    
    # 版本信息
    VERSION = 0.1.0
    # RC_ICONS = app.ico

    # Windows数据库配置 - 需要根据你的实际情况修改路径
    MARIADB_PATH = "C:/Program Files/MariaDB 11.8/"  # 或者你的实际安装路径
    exists($$MARIADB_PATH) {
        MARIADB_INSTALL = $$MARIADB_PATH
        LIBS += -L"$$MARIADB_INSTALL/lib"
        INCLUDEPATH += "$$MARIADB_INSTALL/include"
    }
    contains(QMAKE_TARGET.arch, x86_64) {
        # 64位平台
        TARGET=$${TARGET}_x64
        LIBS += -L'$$PWD/library/openssl/lib/64' -llibcrypto -llibssl
    } else {
        # 32位平台
        TARGET=$${TARGET}_x86
        LIBS += -L'$$PWD/library/openssl/lib/32' -llibcrypto -llibssl
    }
    INCLUDEPATH += $$PWD/library/openssl/include/openssl
    VCPKG_ROOT = "E:/tmp/vcpkg/packages/zlib_x64-windows"
    exists($$VCPKG_ROOT) {
        LIBS += -L"$$VCPKG_ROOT/lib" -lzlib
        INCLUDEPATH += "$$VCPKG_ROOT/include"
    }

    # msvc utf8中文乱码问题解决
    msvc:QMAKE_CXXFLAGS += -execution-charset:utf-8
    msvc:QMAKE_CXXFLAGS += -source-charset:utf-8
}

# 安装设置（如果需要）
target.path = $$[QT_INSTALL_BINS]
INSTALLS += target
